﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace BitcoinMarket
{
    public class CurrencyItemViewModel : INotifyPropertyChanged
    {
        private string _itemTitle;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemTitle
        {
            get
            {
                return _itemTitle;
            }
            set
            {
                if (value != _itemTitle)
                {
                    _itemTitle = value;
                    NotifyPropertyChanged("ItemTitle");
                }
            }
        }

        ///    {"high": 23.745330000000, "latest_trade": 1360613660, "bid": 23.500000000000, "volume": 1303.549317030000, "currency": "AUD",
        /// "currency_volume": 30646.298362235278, "ask": 23.717480000000, "close": 23.729260000000, "avg": 23.50988793585473633593592525,
        /// "symbol": "mtgoxAUD", "low": 23.000000000000}

        private string _itemHigh;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemHigh
        {
            get
            {
                return _itemHigh;
            }
            set
            {
                if (value != _itemHigh)
                {
                    _itemHigh = value;
                    NotifyPropertyChanged("ItemHigh");
                }
            }
        }

        private string _itemLTrade;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemLTrade
        {
            get
            {
                return _itemLTrade;
            }
            set
            {
                if (value != _itemLTrade)
                {
                    _itemLTrade = value;
                    NotifyPropertyChanged("ItemLTrade");
                }
            }
        }

        private string _itemBid;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemBid
        {
            get
            {
                return _itemBid;
            }
            set
            {
                if (value != _itemBid)
                {
                    _itemBid = value;
                    NotifyPropertyChanged("ItemBid");
                }
            }
        }

        private string _itemVolume;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemVolume
        {
            get
            {
                return _itemVolume;
            }
            set
            {
                if (value != _itemVolume)
                {
                    _itemVolume = value;
                    NotifyPropertyChanged("ItemVolume");
                }
            }
        }

        private string _itemCurrencyVolume;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemCurrencyVolume
        {
            get
            {
                return _itemCurrencyVolume;
            }
            set
            {
                if (value != _itemCurrencyVolume)
                {
                    _itemCurrencyVolume = value;
                    NotifyPropertyChanged("ItemCurrencyVolume");
                }
            }
        }

        private string _itemAsk;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemAsk
        {
            get
            {
                return _itemAsk;
            }
            set
            {
                if (value != _itemAsk)
                {
                    _itemAsk = value;
                    NotifyPropertyChanged("ItemAsk");
                }
            }
        }

        private string _itemClose;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemClose
        {
            get
            {
                return _itemClose;
            }
            set
            {
                if (value != _itemClose)
                {
                    _itemClose = value;
                    NotifyPropertyChanged("ItemClose");
                }
            }
        }

        private string _itemAvg;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemAvg
        {
            get
            {
                return _itemAvg;
            }
            set
            {
                if (value != _itemAvg)
                {
                    _itemAvg = value;
                    NotifyPropertyChanged("ItemAvg");
                }
            }
        }

        private string _itemLow;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemLow
        {
            get
            {
                return _itemLow;
            }
            set
            {
                if (value != _itemLow)
                {
                    _itemLow = value;
                    NotifyPropertyChanged("ItemLow");
                }
            }
        }

        private string _itemOpen;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ItemOpen
        {
            get
            {
                return _itemOpen;
            }
            set
            {
                if (value != _itemOpen)
                {
                    _itemOpen = value;
                    NotifyPropertyChanged("ItemOpen");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}